home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 1999 August / maximum-cd-1999-08.iso / Digital Immersion / data1.cab / Program_DLLs / Mshtml.dll / HTML / FIND.DLG < prev    next >
Encoding:
Text File  |  1999-06-14  |  10.8 KB  |  449 lines

  1. <HTML id=dlgFind STYLE="font-family: ms sans serif; font-size: 8pt;
  2. width: 33.5em; height: 11.2em">
  3. <HEAD>
  4. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  5. <TITLE id=dialogTitle>
  6. Find
  7. </TITLE>
  8. <SCRIPT LANGUAGE="JavaScript" defer>
  9. function callHelp(elm)
  10. {
  11. if (null != elm.helpid)
  12. {
  13.  window.showHelp(elm.helpfile, "" + parseInt(elm.helpid),
  14.   "popup");
  15. }
  16. else
  17. {
  18.  if ("BODY" != elm.tagName)
  19.  {
  20.   callHelp(elm.parentElement);
  21.  }
  22. }
  23. function btnCancelClick()
  24. {
  25. window.close();
  26. function getTextRange(elm)
  27. {
  28. var r = elm.parentTextEdit.createTextRange();
  29. r.moveToElementText(elm);
  30. return r;
  31. function mouseClick()
  32. {
  33. if (window.event.srcElement.id.substring(0,3)
  34.  == "txt")
  35. {
  36.  return;
  37. }
  38. if (window.event.button == 2)
  39. {
  40.  callHelp(window.event.srcElement);
  41. }
  42. function txtDefaultESC()
  43. {
  44. if (event.keyCode == 27)
  45. {
  46.  window.close();
  47.  return;
  48. }
  49. window.onerror = HandleError
  50. function HandleError(message, url, line)
  51. {
  52. var L_Dialog_ErrorMessage = "An error has occured in this dialog.";
  53. var L_ErrorNumber_Text = "Error: ";
  54. var str = L_Dialog_ErrorMessage + "\n\n" 
  55.  + L_ErrorNumber_Text + line + "\n"
  56.  + message;
  57. alert (str);
  58. window.close();
  59. return true;
  60. }
  61. function setFindState(fKeyPress) { var htmlKeyAlt = 18; if (!fKeyPress || htmlKeyAlt != event.keyCode) { if (("" == txtFindText.value) == g_fFindEnabled) { btnFind.disabled = g_fFindEnabled; g_fFindEnabled = !g_fFindEnabled; } } else { window.setTimeout("set" + "Find" + "State(false)", 50); } }
  62. var g_fFindEnabled = false; 
  63. var g_docLastFound; 
  64. var g_fFrameset = false; 
  65. var g_arrFrames = new Array(); 
  66. var g_fSearchTopFrame = false; 
  67. var g_fFollowIframes = true;  
  68. function findFlags()
  69. {
  70. var htmlMatchWord = 2;
  71. var htmlMatchCase = 4;
  72. return (htmlMatchWord * document.all.chkWholeWord.checked)
  73.  | (htmlMatchCase * document.all.chkMatchCase.checked)
  74. function CrawlPath()
  75. {
  76. var win = window.dialogArguments.unsecuredWindowOfDocument;
  77. var i = 0;
  78. if (g_fSearchTopFrame)
  79. {
  80.  return win;
  81. }
  82. while (g_arrFrames[i] >= 0)
  83. {
  84.  win = win.frames[g_arrFrames[i]];
  85.  i++;
  86. }
  87. return win;
  88. function AtFrameset()
  89. {
  90. var win = CrawlPath();
  91. return win.frames.length;
  92. function AtIframe()
  93. {
  94. var win = CrawlPath();
  95. return win.document.all.tags("IFRAME").length;
  96. function GetCurrentPos()
  97. {
  98. var i = GetCurrentDepth();
  99. return g_arrFrames[i];
  100. function GetCurrentDepth()
  101. {
  102. var i = 0;
  103. while (g_arrFrames[i] >= 0)
  104. {
  105.  i++;
  106. }
  107. return i-1;
  108. function MovePossible(fForward)
  109. {
  110. var intCurPos = GetCurrentPos();
  111. var win = CrawlPath();
  112. var winParent = win.parent;
  113. if (fForward)
  114. {
  115.  return winParent.frames.length - intCurPos - 1;
  116. }
  117. else
  118. {
  119.  return (intCurPos != 0);
  120. }
  121. function MoveUpFrameset()
  122. {
  123. var i = GetCurrentDepth();
  124. g_arrFrames[i] = -1;
  125. function MoveDownFrameset(fForward)
  126. {
  127. var i = GetCurrentDepth();
  128. var win = CrawlPath();
  129. g_arrFrames[i+1] = fForward ? 0 : win.frames.length - 1;
  130. g_arrFrames[i+2] = -1;
  131. function MoveWin(fForward)
  132. {
  133. var intDepth = GetCurrentDepth();
  134. var intPos = GetCurrentPos();
  135. g_arrFrames[intDepth] = fForward ? ++intPos : --intPos;
  136. function MoveDoc(fForward)
  137. {
  138. if (g_fSearchTopFrame) 
  139.  if (fForward)
  140.  {
  141.   g_fSearchTopFrame = false;
  142.   return true;
  143.  }
  144.  else
  145.  {
  146.   return false;
  147.  }
  148. }
  149. if (!fForward && (g_arrFrames[0] == 0) && (g_arrFrames[1] < 0)
  150.  && window.dialogArguments.document.all.tags("IFRAME").length)
  151. {
  152.  g_fSearchTopFrame = true;
  153.  return true;
  154. }
  155. if (g_fFollowIframes && AtIframe())
  156. {
  157.  MoveDownFrameset(fForward);
  158.  while (!AtIframe() && AtFrameset())
  159.  {
  160.   MoveDownFrameset(fForward);
  161.  }
  162.  return true;
  163. }
  164. if (MovePossible(fForward))
  165. {
  166.  MoveWin(fForward);
  167.  g_fFollowIframes = true;
  168.  while (!AtIframe() && AtFrameset())
  169.  {
  170.   MoveDownFrameset(fForward);
  171.  }
  172.  return true;
  173. }
  174. else
  175. {
  176.  if (GetCurrentDepth() > 0)
  177.  {
  178.   MoveUpFrameset();
  179.   while (AtIframe() && !MovePossible(fForward)
  180.    && (GetCurrentDepth() >= 0))
  181.   {
  182.    MoveUpFrameset();
  183.   }
  184.   if (AtIframe() && MovePossible(fForward))
  185.   {
  186.    g_fFollowIframes = false;
  187.   }
  188.   return MoveDoc(fForward);
  189.  }
  190. }
  191. return false;
  192. function GetFirstDoc()
  193. {
  194. var win;
  195. var doc = window.dialogArguments.document;
  196. if (doc.all.tags("IFRAME").length)
  197. {
  198.  g_fSearchTopFrame = true;
  199.  return doc;
  200. }
  201. while (!AtIframe() && AtFrameset())
  202. {
  203.  MoveDownFrameset(true);
  204. }
  205. win = CrawlPath();
  206. return win.document;
  207. function btnFindClick()
  208. {
  209. var docSearch; 
  210. var L_FinishedDocument_Text = "Finished searching the document.";
  211. var intDirection;  
  212. var rngWorking;   
  213. var rngFoundText;  
  214. var fFoundText = false; 
  215. var index;
  216. if (g_fFrameset)
  217. {
  218.  var win;
  219.  if (!AtIframe() && AtFrameset())
  220.  {
  221.   MoveDownFrameset(!radDirection[0].checked);
  222.   while (!AtIframe() && AtFrameset())
  223.   {
  224.    MoveDownFrameset(!radDirection[0].checked);
  225.   }
  226.  }
  227.  win = CrawlPath();
  228.  docSearch = win.document;
  229. }
  230. else
  231. {
  232.  docSearch = window.dialogArguments.document;
  233. }
  234. if (docSearch.queryCommandState("BrowseMode")
  235.  && docSearch.selection.type != "Text")
  236. {
  237.  if (docSearch.body == null)
  238.   return;
  239.  rngWorking = docSearch.body.createTextRange();
  240. }
  241. else
  242. {
  243.  rngWorking = docSearch.selection.createRange();
  244. }
  245. fFoundText = (docSearch.selection.type == "Text");
  246. if (radDirection[0].checked) 
  247. {
  248.  if (fFoundText)
  249.  {
  250.   rngWorking.moveEnd("character" , -1);
  251.  }
  252.  while (0 != rngWorking.moveStart("textedit", -1))
  253.  {
  254.  }
  255.  intDirection = -1000000;
  256. }
  257. else       
  258. {
  259.  if (fFoundText)
  260.  {
  261.   rngWorking.moveStart("character", 1);
  262.  }
  263.  while (0 != rngWorking.moveEnd("textedit", 1))
  264.  {
  265.  }
  266.  intDirection = 1000000; 
  267. }
  268. rngFoundText = rngWorking.duplicate();
  269. success = rngFoundText.findText(txtFindText.value, 
  270.  intDirection, findFlags());
  271. if (!success) 
  272. {
  273.  if (g_fFrameset)
  274.  {
  275.   if (MoveDoc(!radDirection[0].checked))
  276.   {
  277.    btnFindClick();
  278.    return;
  279.   }
  280.  }
  281.  alert(L_FinishedDocument_Text);
  282.  txtFindText.focus();
  283. }
  284. else      
  285. {
  286.  if (g_fFrameset)
  287.  {
  288.   g_docLastFound.execCommand("Unselect", false);
  289.   g_docLastFound = docSearch;
  290.  }
  291.  rngFoundText.select();
  292.  rngFoundText.scrollIntoView(true);
  293. }
  294. function btnCancelClick2()
  295. {
  296. window.dialogArguments.findText = txtFindText.value;
  297. window.close();
  298. function loadBdy()
  299. {
  300. var win = window.dialogArguments.unsecuredWindowOfDocument;
  301. var doc = window.dialogArguments.document;
  302. btnFind.onclick  = new 
  303.  Function("btnFindClick()");
  304. btnCancel.onclick = new Function("btnCancelClick2()");
  305. document.onhelp  = new Function("callHelp(window.event.srcElement)");
  306. document.onmouseup = new Function("mouseClick()");
  307. txtFindText.onkeyup = new Function("setFindState(true)");
  308. txtFindText.onfocus = new Function("txtFindText.select()");
  309. txtFindText.onkeypress = new Function("txtDefaultESC()");
  310. if (win.frames.length)
  311. {
  312.  var win2;
  313.  g_fFrameset = true;
  314.  g_arrFrames[0] = 0;
  315.  g_arrFrames[1] = -1;
  316.  win2 = CrawlPath();
  317.  doc2 = win2.document;
  318.  while (doc2.selection.type == "None")
  319.  {
  320.   if (MoveDoc(true))
  321.   {
  322.    win2 = CrawlPath();
  323.    doc2 = win2.document;
  324.   }
  325.   else 
  326.   {
  327.    g_arrFrames[0] = 0;
  328.    g_arrFrames[1] = -1;
  329.    break;
  330.   }
  331.  }
  332.  doc = CrawlPath().document;
  333.  g_docLastFound = doc;
  334. }
  335. if (doc.selection.type == "Control")
  336. {
  337.  var r = doc.selection.createRange();
  338.  r = getTextRange(r(0));
  339.  r.select();
  340. }
  341. txtFindText.value = window.dialogArguments.findText;
  342. txtFindText.focus();
  343. txtFindText.select();
  344. setFindState(false);
  345. </SCRIPT>
  346. </HEAD>
  347. <BODY ID=bdy onLoad="loadBdy()" style="font-family: 'ms sans serif';
  348. font-size: 8pt; background: threedface;" topmargin=0 scroll=no>
  349. <BUTTON id=btnFind ACCESSKEY=f DISABLED=1 tabIndex=55 helpid=50026
  350. helpfile="iexplore.hlp"
  351. style="font-family: ms sans serif; font-size: 8pt; position: absolute;
  352. left: 24.78em; top: 1.0647em; width: 7em; height: 2.2em; " type=submit>
  353. <U>F</U>ind Next
  354. </BUTTON>
  355. <DIV align=absMiddle
  356. style="font-family: ms sans serif; font-size: 8pt; position: absolute;
  357. left: 0.98em; top: 1.2168em; width: 4.8em; height: 1.2168em; ">
  358. <LABEL FOR=txtFindText ID=lblFindText tabIndex=-1 helpid=50027
  359. helpfile="iexplore.hlp">
  360. Fi<U>n</U>d what:
  361. </LABEL>
  362. </DIV>
  363. <INPUT type=text id=txtFindText ACCESSKEY=n tabIndex=15 helpid=50027
  364. helpfile="iexplore.hlp"
  365. style="font-family: ms sans serif; font-size: 8pt; position: absolute;
  366. left: 6.16em; top: 1.0647em; width: 17.36em; height: 2.1294em; ">
  367. <BUTTON id=btnCancel tabIndex=60 helpid="0x6F1C" helpfile="windows.hlp"
  368. style="font-family: ms sans serif; font-size: 8pt; position: absolute;
  369. left: 24.78em; top: 3.6504em; width: 7em; height: 2.2em; " type=reset>
  370. Cancel
  371. </BUTTON>
  372. <INPUT id=chkWholeWord ACCESSKEY=w type=checkbox tabIndex=25 
  373. helpfile="iexplore.hlp" helpid=50022
  374. style="font-family: ms sans serif; font-size: 8pt; position: absolute;
  375. left: 0.68em; top: 3.8588em; width: 1em; height: 1em; ">
  376. <INPUT ACCESSKEY=c type=checkbox tabIndex=35 helpid=50023
  377. helpfile="iexplore.hlp"
  378. id=chkMatchCase style="font-family: ms sans serif; font-size: 8pt;
  379. position: absolute; left: 0.68em; top: 5.684em; width: 1em;
  380. height: 1em; ">
  381. <DIV
  382. style="font-family: ms sans serif; font-size: 8pt; position: absolute;
  383. left: 2.6em; top: 4.2588em; width: 12.46em; height: 1.521em; ">
  384. <LABEL FOR=chkWholeWord ID=lblWholeWord tabIndex=-1 helpid=50022
  385. helpfile="iexplore.hlp">
  386. Match <U>w</U>hole word only
  387. </LABEL>
  388. </DIV>
  389. <DIV style="font-family: ms sans serif; font-size: 8pt; position: absolute;
  390. left: 2.6em; top: 6.084em; width: 7.42em; height: 1.521em; ">
  391. <LABEL FOR=chkMatchCase ID=lblMatchCase tabIndex=-1 helpid=50023
  392. helpfile="iexplore.hlp">
  393. Match <U>c</U>ase
  394. </LABEL>
  395. </DIV>
  396. <FIELDSET id=fldDirection style="font-family: ms sans serif; font-size: 8pt; 
  397. position: absolute; left: 13.7em; top: 3.5em; width: 9.7em; 
  398. height: 4.2em;">
  399. <LEGEND>
  400. Direction
  401. </LEGEND>
  402. </FIELDSET>
  403.  <INPUT id=radDirectionUp type=radio name=radDirection ACCESSKEY=u
  404.  tabIndex=42 helpid=50025 helpfile="iexplore.hlp"
  405.  style="font-family: ms sans serif; font-size: 8pt; position: absolute;
  406.  left: 14.26em; top: 5.1235em; width: 1em; height: 1em; ">
  407.  <DIV style="font-family: ms sans serif; font-size: 8pt;
  408.  position: absolute; left: 16.2em; top: 5.3235em; width: 3.5em;
  409.  height: 1.521em; ">
  410.  <LABEL ID=lblDirectionUp style="font-family: 'ms sans serif'; font-size: 8pt"
  411.  FOR=radDirectionUp
  412.  tabIndex=45 helpid=50025
  413.  helpfile="iexplore.hlp"> <U>U</U>p </LABEL>
  414.  </DIV>
  415.  <INPUT id=radDirectionDown type=radio CHECKED name=radDirection
  416.  ACCESSKEY=d tabIndex=47 helpid=50024 helpfile="iexplore.hlp"
  417.  style="font-family: ms sans serif; font-size: 8pt; position: absolute;
  418.  left: 18.18em; top: 5.1235em; width: 1em; height: 1em; ">
  419.  <DIV style="font-family: ms sans serif; font-size: 8pt;
  420.  position: absolute; left: 20.1em; top: 5.3235em; width: 4.9em;
  421.  height: 1.521em; ">
  422.  <LABEL ID=lblDirectionDown style="font-family: 'ms sans serif'; font-size: 8pt"
  423.  FOR=radDirectionDown helpid=50024 helpfile="iexplore.hlp"
  424.  tabIndex=50> <U>D</U>own </LABEL>
  425.  </DIV>
  426. </BODY>
  427. </HTML>
  428.